from sqlalchemy import Column, Integer, String, Boolean
from sqlalchemy.ext.declarative import declarative_base

from app.models.base import BaseModel

Base = declarative_base()


class UserAddress(BaseModel):
    """用户地址表模型"""
    __tablename__ = "user_address"
    __table_args__ = {"comment": "用户收货地址信息"}

    address_id = Column(Integer, primary_key=True, comment="地址ID")
    name = Column(String(50), comment="收件人姓名")
    phone = Column(String(20), comment="收件人电话")
    province_id = Column(Integer, comment="省份ID")
    province_name = Column(Integer, comment="省份名称")
    city_id = Column(Integer, comment="城市ID")
    city_name = Column(Integer, comment="城市名称")
    region_id = Column(Integer, comment="区/县ID")
    region_name = Column(Integer, comment="区/县名称")
    detail = Column(String(200), comment="详细地址")
    user_id = Column(Integer, comment="用户id")
    is_default = Column(Boolean,comment="是否默认")
